﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;
using System.ComponentModel.DataAnnotations.Schema;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——商品
    /// </summary>
    [Serializable]
    [Description("商品")]
    public class Product :  EntityBase,ICreatedTime, IAudited,IRecyclable
    {
        /// <summary>
        ///条码
        /// </summary>
        [Display(Name = "条码")]
        [Required, StringLength(50)]
        public string SN { get; set; }

        /// <summary>
        ///商品编号
        /// </summary>
        [Display(Name = "商品编号")]
        [StringLength(50)]
        public string Code { get; set; }

        /// <summary>
        ///商品简称
        /// </summary>
        [Display(Name = "商品简称")]
        [Required, StringLength(50)]
        public string ShortName { get; set; }

        /// <summary>
        ///商品类型
        /// </summary>
        [Display(Name = "商品类型")]
        public virtual ProductType ProductType { get; set; }
        /// <summary>
        ///商品类型外键
        /// </summary>
        [Display(Name = "商品类型外键")]
        public long ProductTypeId { get; set; }

        /// <summary>
        ///品牌
        /// </summary>
        [Display(Name = "品牌")]
        public virtual Brand Brand { get; set; }
        /// <summary>
        ///品牌外键
        /// </summary>
        [Display(Name = "品牌外键")]
        public long BrandId { get; set; }

        /// <summary>
        ///商品全称
        /// </summary>
        [Display(Name = "商品全称")]
        [Required, StringLength(50)]
        public override string Name { get; set; }

        /// <summary>
        ///默认供应商
        /// </summary>
        [Display(Name = "默认供应商")]
        public virtual Supplier DefaultSupplier { get; set; }
        /// <summary>
        ///默认供应商外键
        /// </summary>
        [Display(Name = "默认供应商外键")]
        public long? DefaultSupplierId { get; set; }

        /// <summary>
        ///单位
        /// </summary>
        [Display(Name = "单位")]
        public virtual ProductUnit ProductUnit { get; set; }
        /// <summary>
        ///单位外键
        /// </summary>
        [Display(Name = "单位外键")]
        public long ProductUnitId { get; set; }

        ///// <summary>
        /////等级
        ///// </summary>
        //[Display(Name = "等级")]
        //[StringLength(50)]
        //public string Level { get; set; }

        /// <summary>
        ///规格/油品类型
        /// </summary>
        [Display(Name = "规格")]
        [StringLength(50)]
        public string Specifications { get; set; }

        /// <summary>
        ///型号
        /// </summary>
        [Display(Name = "型号")]
        [StringLength(50)]
        public string Model { get; set; }

        /// <summary>
        ///重量
        /// </summary>
        [Display(Name = "重量")]
        public double Weight { get; set; }

        /// <summary>
        ///单位
        /// </summary>
        [Display(Name = "单位")]
        [StringLength(50)]
        public string Unit { get; set; }

        /// <summary>
        ///图片1
        /// </summary>
        [Display(Name = "图片1")]
        [StringLength(200)]
        public string ImgUrl1 { get; set; }

        /// <summary>
        ///图片2
        /// </summary>
        [Display(Name = "图片2")]
        [StringLength(200)]
        public string ImgUrl2 { get; set; }

        /// <summary>
        ///图片3
        /// </summary>
        [Display(Name = "图片3")]
        [StringLength(200)]
        public string ImgUrl3 { get; set; }

        /// <summary>
        ///图片4
        /// </summary>
        [Display(Name = "图片4")]
        [StringLength(200)]
        public string ImgUrl4 { get; set; }

        /// <summary>
        ///图片5
        /// </summary>
        [Display(Name = "图片5")]
        [StringLength(200)]
        public string ImgUrl5 { get; set; }

        /// <summary>
        ///年份
        /// </summary>
        [Display(Name = "年份")]
        [StringLength(50)]
        public string Year { get; set; }

        /// <summary>
        ///上市时间
        /// </summary>
        [Display(Name = "上市时间")]
        public DateTime? MarketTime { get; set; }

        /// <summary>
        ///明细概要
        /// </summary>
        [Display(Name = "明细概要")]
        [StringLength(500)]
        public string Outline { get; set; }

        /// <summary>
        ///产品说明
        /// </summary>
        [Display(Name = "产品说明")]
        [StringLength(500)]
        public string Explain { get; set; }

        /// <summary>
        ///技术参数
        /// </summary>
        [Display(Name = "技术参数")]
        [StringLength(500)]
        public string TechnicalParameter { get; set; }

        /// <summary>
        ///常见问题
        /// </summary>
        [Display(Name = "常见问题")]
        [StringLength(500)]
        public string CommonProblem { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [StringLength(500)]
        public string Remark { get; set; }

        /// <summary>
        ///标价
        /// </summary>
        [Display(Name = "标价")]
        [Required]
        public float MarkedPrice { get; set; }

        /// <summary>
        ///默认成本价
        /// </summary>
        [Display(Name = "默认成本价")]
        [Required]
        public float DefaultCostPrice { get; set; }

        /// <summary>
        ///零售价
        /// </summary>
        [Display(Name = "零售价")]
        [Required]
        public float RetailPrice { get; set; }

        /// <summary>
        ///VIP价1
        /// </summary>
        [Display(Name = "VIP价1")]
        [Required]
        public float VIPPrice1 { get; set; }

        /// <summary>
        ///VIP价2
        /// </summary>
        [Display(Name = "VIP价2")]
        [Required]
        public float VIPPrice2 { get; set; }

        /// <summary>
        ///VIP价3
        /// </summary>
        [Display(Name = "VIP价3")]
        [Required]
        public float VIPPrice3 { get; set; }

        /// <summary>
        ///VIP价4
        /// </summary>
        [Display(Name = "VIP价4")]
        [Required]
        public float VIPPrice4 { get; set; }

        /// <summary>
        ///批发价1
        /// </summary>
        [Display(Name = "批发价1")]
        [Required]
        public float TradePrice1 { get; set; }

        /// <summary>
        ///批发价2
        /// </summary>
        [Display(Name = "批发价2")]
        [Required]
        public float TradePrice2 { get; set; }

        /// <summary>
        ///批发价3
        /// </summary>
        [Display(Name = "批发价3")]
        [Required]
        public float TradePrice3 { get; set; }

        /// <summary>
        ///批发价4
        /// </summary>
        [Display(Name = "批发价4")]
        [Required]
        public float TradePrice4 { get; set; }

        /// <summary>
        ///批发价5
        /// </summary>
        [Display(Name = "批发价5")]
        [Required]
        public float TradePrice5 { get; set; }

        /// <summary>
        ///批发价6
        /// </summary>
        [Display(Name = "批发价6")]
        [Required]
        public float TradePrice6 { get; set; }

        /// <summary>
        ///批发价7
        /// </summary>
        [Display(Name = "批发价7")]
        [Required]
        public float TradePrice7 { get; set; }

        /// <summary>
        ///批发价8
        /// </summary>
        [Display(Name = "批发价8")]
        [Required]
        public float TradePrice8 { get; set; }

        /// <summary>
        ///重点跟踪
        /// </summary>
        [Display(Name = "重点跟踪")]
        [Required]
        public bool FocusTracking { get; set; }

        /// <summary>
        ///新品
        /// </summary>
        [Display(Name = "新品")]
        [Required]
        public bool IsNew { get; set; }

        /// <summary>
        ///易断货商品
        /// </summary>
        [Display(Name = "易断货商品")]
        [Required]
        public bool EasyStock { get; set; }


        /// <summary>
        /// 商品种类 0普通商品 1油 2售油机
        /// </summary>
        [Display(Name = "商品种类")]
        public int ProductClass { get; set; }

        /// <summary>
        ///兑换积分
        /// </summary>
        [Display(Name = "兑换积分")]
        [Required]
        public bool ExchangeIntegral { get; set; }

        /// <summary>
        ///前台赠送
        /// </summary>
        [Display(Name = "前台赠送")]
        [Required]
        public bool FrontDesk { get; set; }

        /// <summary>
        ///不积分
        /// </summary>
        [Display(Name = "不积分")]
        [Required]
        public bool NoIntegral { get; set; }

        /// <summary>
        ///特价商品不打折
        /// </summary>
        [Display(Name = "特价商品不打折")]
        [Required]
        public bool NoDiscount { get; set; }

        /// <summary>
        ///停用
        /// </summary>
        [Display(Name = "停用")]
        [Required]
        public bool Enable { get; set; }

        /// <summary>
        ///管理序列号
        /// </summary>
        [Display(Name = "管理序列号")]
        [Required]
        public bool ManageSerialNum { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion

        #region Implementation of IsDeleted 逻辑删除接口
        /// <summary>
        /// 逻辑删除接口
        /// </summary>
        [Display(Name = "是否删除")]
        public bool IsDeleted { get; set; }
        #endregion
    }
}
